<?php 
	
	class MainMenu_Helper {
	    public function showMenu($id) {
	        $attribute = array('rel'=>'','alt'=>'','title'=>'');
	        $baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
	        $controller = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
	        $action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();
	  		$model = new Model_Menu_Menu();
	  		$data = $model->getItemsByCateOrder($id);
	  		$active = array();
	  		foreach ($data as $item)
	  		{
	  		    if($item['rel']!='')
	  		    	$attribute['rel'] = ' rel = "'.$item['rel'].'" ';
	  		    else
	  		        $attribute['rel'] = '';
	  		    if($item['alt']!='')
	  		    	$attribute['alt'] = ' alt = "'.$item['alt'].'" ';
	  		    else
	  		        $attribute['alt'] = '';
	  		    if($item['title']!='')
	  		    	$attribute['title'] = ' title = "'.$item['title'].'" ';
	  		    else
	  		        $attribute['title'] = '';
	  		  	echo '<li'.$active[$item['name']].'><a href="'.$baseUrl.$item['link'].'"'.$attribute['rel'].$attribute['alt'].$attribute['title'].'>'.$item['name'].'</a></li>';	  		
	  		}    
	    }
	}
?>